3.338 \(\int \frac {\tan ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx\)

Optimal. Leaf size=45 \[ \frac {(a+b) \log \left (a \cos ^2(e+f x)+b\right )}{2 a b f}-\frac {\log (\cos (e+f x))}{b f} \]

[Out]

-ln(cos(f*x+e))/b/f+1/2*(a+b)*ln(b+a*cos(f*x+e)^2)/a/b/f

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {4138, 446, 72} \[ \frac {(a+b) \log \left (a \cos ^2(e+f x)+b\right )}{2 a b f}-\frac {\log (\cos (e+f x))}{b f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^3/(a + b*Sec[e + f*x]^2),x]

[Out]

-(Log[Cos[e + f*x]]/(b*f)) + ((a + b)*Log[b + a*Cos[e + f*x]^2])/(2*a*b*f)

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {\tan ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {1-x^2}{x \left (b+a x^2\right )} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\operatorname {Subst}\left (\int \frac {1-x}{x (b+a x)} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {\operatorname {Subst}\left (\int \left (\frac {1}{b x}+\frac {-a-b}{b (b+a x)}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {\log (\cos (e+f x))}{b f}+\frac {(a+b) \log \left (b+a \cos ^2(e+f x)\right )}{2 a b f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.10, size = 41, normalized size = 0.91 \[ \frac {(a+b) \log \left (a \cos ^2(e+f x)+b\right )-2 a \log (\cos (e+f x))}{2 a b f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^3/(a + b*Sec[e + f*x]^2),x]

[Out]

(-2*a*Log[Cos[e + f*x]] + (a + b)*Log[b + a*Cos[e + f*x]^2])/(2*a*b*f)

________________________________________________________________________________________

fricas [A]  time = 0.70, size = 41, normalized size = 0.91 \[ \frac {{\left (a + b\right )} \log \left (a \cos \left (f x + e\right )^{2} + b\right ) - 2 \, a \log \left (-\cos \left (f x + e\right )\right )}{2 \, a b f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

1/2*((a + b)*log(a*cos(f*x + e)^2 + b) - 2*a*log(-cos(f*x + e)))/(a*b*f)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check si
gn: (2*pi/x/2)>(-2*pi/x/2)2/f*(-1/4/b*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+
cos(f*x+exp(1)))-2))-1/4/a*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+cos(f*x+exp
(1)))+2))+(-b^2-2*b*a-a^2)/(-4*b^2*a-4*b*a^2)*ln(abs(((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp
(1)))*(1+cos(f*x+exp(1))))*b+((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+cos(f*x+exp(1))
))*a+2*b-2*a)))

________________________________________________________________________________________

maple [A]  time = 0.64, size = 59, normalized size = 1.31 \[ \frac {\ln \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}{2 f b}+\frac {\ln \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}{2 a f}-\frac {\ln \left (\cos \left (f x +e \right )\right )}{b f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^3/(a+b*sec(f*x+e)^2),x)

[Out]

1/2/f/b*ln(b+a*cos(f*x+e)^2)+1/2*ln(b+a*cos(f*x+e)^2)/a/f-ln(cos(f*x+e))/b/f

________________________________________________________________________________________

maxima [A]  time = 0.36, size = 50, normalized size = 1.11 \[ \frac {\frac {{\left (a + b\right )} \log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{a b} - \frac {\log \left (\sin \left (f x + e\right )^{2} - 1\right )}{b}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

1/2*((a + b)*log(a*sin(f*x + e)^2 - a - b)/(a*b) - log(sin(f*x + e)^2 - 1)/b)/f

________________________________________________________________________________________

mupad [B]  time = 4.49, size = 64, normalized size = 1.42 \[ \frac {\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a+b\right )}{2\,a\,f}+\frac {\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a+b\right )}{2\,b\,f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,a\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)^3/(a + b/cos(e + f*x)^2),x)

[Out]

log(a + b + b*tan(e + f*x)^2)/(2*a*f) + log(a + b + b*tan(e + f*x)^2)/(2*b*f) - log(tan(e + f*x)^2 + 1)/(2*a*f
)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan ^{3}{\left (e + f x \right )}}{a + b \sec ^{2}{\left (e + f x \right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**3/(a+b*sec(f*x+e)**2),x)

[Out]

Integral(tan(e + f*x)**3/(a + b*sec(e + f*x)**2), x)

________________________________________________________________________________________